<template>
  <el-dialog
    :title="dialogName.title"
    :visible.sync="dialogName.show"
    :close-on-click-modal='false'
    :close-on-press-escape='false'
    :modal-append-to-body="false"
    center
    width="78%">

    <div class="form">
      <el-form
        :model="form"
        label-width="100px"
        size="mini"
        label-position="top"
        style="margin:10px;width:auto;"
      >

        <el-row>
          <el-col :span="13">
            <el-row class="baseInfo">
              <span>基本信息</span>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop='nam' label="设备名称" class="itemHeigh">
                  <span>{{form.nam}}</span>
                  <!--<el-input type="text" v-model="form.nam" readonly></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='devId' label="设备ID">
                  <span>{{form.devId}}</span>
                  <!--<el-input type="text" v-model="form.devId" readonly></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop='imei' label="设备识别码">
                  <span>{{form.imei}}</span>
                  <!-- <el-input type="name" v-model="form.name" readonly></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='location' label="区域">
                  <span>{{form.location}}</span>
                  <!--<el-input type="model" v-model="form.model" readonly></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop='status' label="状态">
                  <span>{{form.swi | userStatus}}</span>
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="11">
            <el-row class="baseInfo">
              <span>系统</span>
            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='productName' label="产品名称">
                  <span>{{form.productName}}</span>
                  <!--<el-input type="code" v-model="form.code" disabled></el-input>-->
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item prop='type' label="设备类型">
                  <span>{{form.type}}</span>
                  <!--<el-input type="type" v-model="form.type"></el-input>-->
                </el-form-item>
              </el-col>

            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='mnufactor' label="厂商名称">
                  <span>{{form.mnufactor}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='productId' label="厂商ID">
                  <span>{{form.productId}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='model' label="型号">
                  <span>{{form.model}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='protocol' label="协议">
                  <span>{{form.protocol}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='sn' label="序列号">
                  <span>{{form.sn}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='rom' label="固件版本">
                  <span>{{form.fw}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='software' label="软件版本">
                  <span>{{form.software}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop='rom' label="硬件版本">
                  <span>{{form.hardware}}</span>
                  <!--<el-input type="mnufactor" v-model="form.mnufactor"></el-input>-->
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>

              <el-col :span="12">
                <el-form-item prop='mac' label="MAC地址">
                  <span>{{form.mac}}</span>
                  <!--<el-input type="mac" v-model="form.mac"></el-input>-->
                </el-form-item>
              </el-col>


            </el-row>
          </el-col>

        </el-row>

      </el-form>
    </div>

    <span slot="footer" class="dialog-footer">
          <el-button @click="dialogUp">取 消</el-button>
      </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'ShowInfo',
  props: {
    dialogName: {
      type: Object,
      default: {show:false,title:"查看设备信息"}
    },
    form:{
      type:Object,
      default:{}
    }
  },
  methods:{
    dialogUp(){
      this.$emit('setColse')
    }
  }
}
</script>

<style scoped>

</style>
